package com.sinping.qh.query.lab;

import com.sinping.qh.query.base.Operator;
import com.sinping.qh.query.base.QueryParams;
import lombok.Data;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * @author jiahuaiqing
 * @create 2018/6/4
 */
@Data
public class InspectItemTwoQuery implements QueryParams,Serializable {
    private static final long serialVersionUID = -7051815158247377557L;
    static Map<String, String> aliasMap = new HashMap<>();
    static Map<String, Operator> operatorMap = new HashMap<>();

    /**
     * 名称
     */
    private String itemDesc;

    /**
     * 分类
     */
    private String itemSubcategory;

    static {
        aliasMap.put("itemDesc", "inspect_item_two.inspect_item_three.item_desc");
        aliasMap.put("itemSubcategory", "item_subcategory");

        operatorMap.put("itemDesc", Operator.eq);
        operatorMap.put("itemSubcategory", Operator.eq);
    }

    @Override
    public String getAlias(String fieldName) {
        return aliasMap.getOrDefault(fieldName, fieldName);
    }

    @Override
    public Operator getOperators(String fieldName) {
        return operatorMap.getOrDefault(fieldName, Operator.eq);
    }
}
